package com.ygqh.baby.observer.Observable;

import com.ygqh.baby.observer.ChannelScanModel;
import com.ygqh.baby.observer.DrawPrizeHelpObserver;
import com.ygqh.baby.observer.VoteHelpObserver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import java.util.Observable;

/**
 * 微信渠道扫描
 *
 * @author: sunshuo
 * @date: 2018/12/25 15:59
 */
@Component
public class ChannelScanObservable extends Observable {

	@Autowired
	private DrawPrizeHelpObserver drawPrizeHelpObserver;
	@Autowired
	private VoteHelpObserver voteHelpObserver;

	@PostConstruct
	private void initObserver() {
		this.addObserver(voteHelpObserver);
		this.addObserver(drawPrizeHelpObserver);
	}

	public void channelScan(ChannelScanModel channelScanModel) {
		this.setChanged();
		this.notifyObservers(channelScanModel);
	}

}
